﻿@model _1._11._2015_BookReview.Models.BooksViewModel

@{
    ViewBag.Title = "Home Page";
}

<div class="jumbotron">
    <h1>Books</h1>
</div>

<div class="row">
    <div class="col-md-12">
        <table class="table table-bordered table-striped">
            <tr>
                <th>Book</th>
                <th>Author</th>
            </tr>

            @foreach (var b in Model.Books)
            {
                <tr>
                    <td>@Html.ActionLink(@b.Title, "Detail", new { id = @b.BookId })</td>
                    <td>@(b.AuthorFName + " " + b.AuthorLName)</td>
                </tr>

            }
        </table>    
            
    </div>
</div>

<div class="row">
    <div class="col-md-4"></div>
    <div class="col-md-4">
        <button class="btn btn-primary right" onclick="location.href='@Url.Action("CreateBook", "Home")';return false;">Add Book</button>
    </div>
    <div class="col-md-4"></div>
</div>